package org.siberia.client.action;

import java.util.ArrayList;
import java.util.List;

import org.siberia.client.bean.UserDTO;
import org.siberia.client.service.UserService;
import org.siberia.client.service.UserServiceAsync;

import com.extjs.gxt.ui.client.widget.MessageBox;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;

public class EraseDataAction implements Action
{
	@Override
	public void run()
	{
		UserServiceAsync userService = GWT.create(UserService.class);
			
		userService.deleteAll(new AsyncCallback<Void>()
		{
			@Override
			public void onFailure(Throwable caught)
			{
				MessageBox.info("error", "error when trying to delete all users", null);
			}

			@Override
			public void onSuccess(Void result)
			{
				MessageBox.info("info", "erase done", null);
			}
		});
	}
}
